<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<#include "../commons/imports.html"/>
</head>
<body class="layui-layout-body">

	<div class="layui-layout layui-layout-admin">
		<#include "../commons/header.html"/> 
		<#include "../commons/sider.html"/>
		<div class="layui-body">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 3px;">
				<legend>当前在线用户数量：${onlineCount!}</legend>
			</fieldset>
			<!-- 内容主体区域 -->
			<div style="padding: 5px;">
				<table class="layui-table">
					<colgroup>
						<col width="200">
						<col width="200">
						<col width="150">
						<col width="150">
						<col width="200">
						<col width="200">
						<col width="200">
						<col width="100">
					</colgroup>
					<thead>
						<tr>
							<th>SESSION_ID</th>
							<th>SESSION有效期(毫秒)</th>
							<th>用户名称</th>
							<th>主机地址</th>
							<th>会话开始时间</th>
							<th>最后访问时间</th>
							<th>是否已强制退出</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<#list onlineUsers as onlineUser>
						<tr>
							<td>${onlineUser.sessionId!}</td>
							<td>${onlineUser.timeout!}</td>
							<td>${onlineUser.userName!}</td>
							<td>${onlineUser.host!}</td>
							<td>${onlineUser.startTime!?string("yyyy-MM-dd HH:mm:ss")}</td>
							<td>${onlineUser.lastAccess!?string("yyyy-MM-dd HH:mm:ss")}</td>
							<td>${onlineUser.forceLogout!?string('是','否')}</td>
							<td>
							<#if !onlineUser.forceLogout>
								<a class="layui-btn layui-btn-mini" 
								href="${ctx}/online/do_force_fogout?sessionId=${onlineUser.sessionId!}">
								<i class="layui-icon">&#xe642;</i> 强制退出</a>
							</#if>

							</td>
						</tr>

						</#list>
					</tbody>
				</table>

			</div>
		</div>
		<#include "../commons/footer.html"/>
	</div>
	<script>
		layui.use('element', function() {
			var element = layui.element;
			$("#nav_onlines").addClass("layui-bg-green");
		});
	</script>
</body>
</html>